<?php
class gasto_model extends CI_Model {

    public function construct() {
        parent::__construct();
    }

    public function gastoinsert($params) {
        $sql = "call uspcaj_gastodiarioinsert(?,?,?,?,?)";
        $this->db->query($sql, $params);        
    }
    
     
      public function gastohoygetall($params) {
        $sql = "call uspcaj_gastosgetfechaall(?)";
        $query = $this->db->query($sql, $params);     
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[] = $fila;
            endforeach;
        }else {
            $data = null;
        }
        return $data;
        
    }
    
     public function cierregethoy($params) {
        $sql = "call uspcaj_cierregetall(?)";
        $query = $this->db->query($sql, $params);     
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[] = $fila;
            endforeach;
        }else {
            $data = null;
        }
        return $data;
        
    }
    
    public function aperturainsert($params) {
        $sql = "CALL uspcaj_aperturainsert(?,?,?,?)";
        $this->db->query($sql, $params);        
    }
    
    
    
}
?>
